package boun.center;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;

public class Tweet implements Serializable {
    private static final long serialVersionUID = 1L;
    private String text;
    private Calendar creationDate;
    
    public Tweet(String text, String dateString) throws ParseException {
        this.text = text;
        
        this.creationDate = Calendar.getInstance();
        // example: Tue Dec 13 05:28:09 +0000 2011
        SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM d HH:mm:ss Z yyyy", Locale.US);
        this.creationDate.setTime(sdf.parse(dateString));
    }

    public String getText() {
        return text;
    }

    public Calendar getCreationDate() {
        return this.creationDate;
    }

}
